package net.bwie.realtime.jtp.log.function;

import net.bwie.realtime.jtp.log.bean.PageViewBean;
import org.apache.flink.api.common.functions.ReduceFunction;

/**
 * 简介说明:
 *
 * @author: LiLi
 * @date: 2025/05/20 15:59:38
 * @version: 1.0
 */
public class PageViewReportReduceFunction implements ReduceFunction<PageViewBean> {
    @Override
    public PageViewBean reduce(PageViewBean tmp, PageViewBean bean) throws Exception {

        tmp.setPvCount(tmp.getPvCount() + bean.getPvCount());
        tmp.setPvDuringTime(tmp.getPvDuringTime() + bean.getPvDuringTime());
        tmp.setUvCount(tmp.getUvCount() + bean.getUvCount());
        tmp.setSessionCount(tmp.getSessionCount() + bean.getSessionCount());
        // 2返回结果
        return tmp;
    }
}
